package com.cykj.controller;

import com.alibaba.fastjson.JSON;
import com.cykj.bean.Message;
import com.cykj.bean.TbUser;
import com.cykj.bean.TbUserCollection;
import com.cykj.service.CollectionService;
import com.cykj.service.UserService;
import com.cykj.utils.RedisUtil;
import com.cykj.utils.TokenUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/CollectionController")
public class CollectionController {

    @Autowired
    CollectionService collectionService;
    
    @Autowired
    RedisUtil redisUtil;

    @RequestMapping("/getlist")
    public Message login(String token){
        Message message = new Message();
        TbUser tbUser = JSON.parseObject(redisUtil.get(token),TbUser.class);
        List <TbUserCollection> list = collectionService.getlist(tbUser.getUserId());
        return message;
    }
    
}
